'use strict';

var __importDefault =
    (this && this.__importDefault) ||
    function (mod) {
        return mod && mod.__esModule
            ? mod
            : {
                  default: mod
              };
    };

exports.__esModule = true;
/*
  两种网络请求：postRequest => POST, getRequest => GET
  请求头header: 默认json，支持自定义({})或快速写入('form', 'json')
*/

var request_1 =require('../../utils/request');

var globalData_1 = require('../../globalData');

var request = new request_1['default']({
    ApiUrl: globalData_1['default'].marketingUrl
}); // 推广审核记录详情

exports.auditDetail = function (data) {
    return request.postRequest({
        url: 'app/spread/audit/detail',
        data: data
    });
}; // 推广规则

exports.getRule = function () {
    return request.getRequest({
        url: 'app/spread/rule/list'
    });
}; // 降级规则

exports.getReduceRule = function (data) {
    return request.getRequest({
        url: 'app/spread/bscrule/detail',
        data: data
    });
}; // 推广配置

exports.getParamsConfig = function () {
    return request.getRequest({
        url: 'app/spread/column/list'
    });
}; // 推广申请

exports.applyPost = function (data) {
    return request.postRequest({
        url: 'app/spread/audit/add',
        data: data
    });
}; 
// 推广详情
exports.getPromoterDetail = function (data) {
    return request.postRequest({
        url: 'app/spread/user/detail',
        data: data
    });
}; 
// 累计推广奖励
exports.getRewardTotal = function (data) {
    return request.postRequest({
        url: 'app/spread/user/reward/total',
        data: data
    });
};
// 推广记录
exports.getPromotionList = function (data) {
    return request.getRequest({
        url: 'app/spread/user/list',
        data: data
    });
}; 

// 推广员新用户注册调用
exports.promotionUserAdd = function (data) {
    return request.postRequest({
        url: 'app/spread/user/add',
        data: data
    });
};
 // 推广员新用户注册后获得奖励
exports.promotionAddReward = function (data) {
    return request.postRequest({
        url: 'app/spread/user/add/reward',
        data: data
    });
};

//【推广中心 - 查询推广人是否存在】
exports.getUserInandRece = function(plUserId) {
	return request.getRequest({
		url: `app/spread/user/getUserInandRece/${plUserId}`
	});
};

//【推广中心 - 查询推广人各项数据】
exports.getUserInandReceData = function(plUserId) {
	return request.getRequest({
		url: `app/spread/user/getUserInandReceData/${plUserId}`
	});
};

//【推广中心】 -查询推广拉新消费账单详情列表
exports.getBillList = function(data) {
	return request.postRequest({
		url: `app/spread/user/detailed/bill/list`,
		data: data
	});
};
//【推广中心】 - 查询推广拉新消费账单明细列表
exports.getBillDetails = function(params) {
	return request.postRequest({
		url: `app/spread/user/billing/details/list`,
		data: params
	});
};
//【推广中心】 -查询查询推广首月消费账单详情列表
exports.getExpenseList = function(data) {
	return request.postRequest({
		url: `app/spread/user/expense/list`,
		data: data
	});
};
//【推广中心】 -  查询推广首月消费账单明细列表
exports.getExpenseDetails = function(params) {
	return request.postRequest({
		url: `app/spread/user/month/bill/list`,
		data: params
	});
};